package com.shop.entity;

// Generated 2015-10-7 22:59:34 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ThirdClass generated by hbm2java
 */
@Entity
@Table(name = "third_class", catalog = "shop")
public class ThirdClass implements java.io.Serializable {

	private Integer id;
	private SecondClass secondClass;
	private String className;
	private Set<ShopClass> shopClasses = new HashSet<ShopClass>(0);
	private Set<Product> products = new HashSet<Product>(0);

	public ThirdClass() {
	}

	public ThirdClass(SecondClass secondClass, String className,
			Set<ShopClass> shopClasses, Set<Product> products) {
		this.secondClass = secondClass;
		this.className = className;
		this.shopClasses = shopClasses;
		this.products = products;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parent_id")
	public SecondClass getSecondClass() {
		return this.secondClass;
	}

	public void setSecondClass(SecondClass secondClass) {
		this.secondClass = secondClass;
	}

	@Column(name = "class_name", length = 50)
	public String getClassName() {
		return this.className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "thirdClass")
	public Set<ShopClass> getShopClasses() {
		return this.shopClasses;
	}

	public void setShopClasses(Set<ShopClass> shopClasses) {
		this.shopClasses = shopClasses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "thirdClass")
	public Set<Product> getProducts() {
		return this.products;
	}

	public void setProducts(Set<Product> products) {
		this.products = products;
	}

}
